package com.mvvm.start.main.mvvm.v.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
import androidx.viewpager2.adapter.FragmentStateAdapter

 /**
  * @功能: 首页viewpager和底部view适配器
  * @User Lmy
  * @Creat 2021/10/29 7:30 下午
  * @Compony 永远相信美好的事情即将发生
  */
class BottomAdapter(
    fm: FragmentManager,
    lifecycle: Lifecycle,
    val fragments: MutableList<Fragment>
) :
    FragmentStateAdapter(fm, lifecycle) {
    override fun getItemCount(): Int {
        return fragments.size
    }
    override fun createFragment(position: Int): Fragment {
        return fragments.get(position);
    }
}